import Vue from 'vue';
import App from './App.vue';
import router from './router/router';
import store from './store/store';
import Vant from 'vant';
import request from './request/request';
import 'vant/lib/index.css';
import { Popup, Toast } from 'vant';
import Vconsole from 'vconsole';
import VueQriously from 'vue-qriously';
import filters from '@/common/filters';
// import VeLine from 'v-charts/lib/line.common'; // 引入图表
import 'swiper/dist/css/swiper.css'; // 抢购时间条swiper
import reLogin from './components/login/reLogin';
import InfiniteLoading from 'vue-infinite-loading'; //vue loading 插件
import VueQRCodeComponent from 'vue-qrcode-component';
import vueLazyload from 'vue-lazyload';
import * as fundebug from 'fundebug-javascript';
import fundebugVue from 'fundebug-vue';
Vue.use(vueLazyload);

Vue.use(InfiniteLoading, {
    /* 配置 */
    slots: {
        spinner: '加载中',
        noMore: '暂无更多，敬请期待', // you can pass a string value
        noResults: '暂无更多，敬请期待'
        // error: InfiniteError, // you also can pass a Vue component as a slot
    },
    props: {
        spinner: 'circles'
        /* other props need to configure */
    }
});

//非生产环境加载vConsole/生产环境传vConsole也打开
if (process.env.NODE_ENV !== 'production' || window.vConsole) {
    let vConsole = new Vconsole();
    Vue.prototype.$vConsole = vConsole;
}
// let vConsole = new Vconsole();
// Vue.prototype.$vConsole = vConsole;
Vue.use(Vant, Popup, Toast);
Vue.use(VueQriously);

Vue.component('reLogin', reLogin);
Vue.component('qrcode', VueQRCodeComponent);
// Vue.component(VeLine.name, VeLine); // 图表使用
Vue.component('Qriously', VueQriously);
Vue.config.productionTip = false;

Vue.prototype.request = request;
fundebug.apikey = '24405b5720b0b21d5d02004bef2b801cae0141969198464521b57ae4906eb4f3';
fundebugVue(fundebug, Vue);
//高德地图引入
// Vue.use(VueAMap);
// VueAMap.initAMapApiLoader({
//     key: amapKey,
//     plugin: ['AMap.Geolocation', 'AMap.DistrictSearch'],
//     v: '1.4.4', // sdk版本号,
//     uiVersion: '1.0.11' // UI组件库版本号
// });
//注册全局过滤器
Object.keys(filters).forEach(key => Vue.filter(key, filters[key]));
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app');
